package com.shtel.custbehavior.config;


import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@AutoConfigureAfter(MyBatisAutoCreateTableConfig.class)
public class MyBatisMapperScannerConfig {

    @Value("${mybatis.model.pack}")
    private String basepackagepath;

    @Bean
    public MapperScannerConfigurer mapperScannerConfigurer() throws Exception{
        MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
        basepackagepath = basepackagepath+".*;com.gitee.sunchenbin.mybatis.actable.dao.*";
        //mapperScannerConfigurer.setBasePackage("com.shtel.customerInfo.mapper.*;com.gitee.sunchenbin.mybatis.actable.dao.*");
        mapperScannerConfigurer.setBasePackage(basepackagepath);
        mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactory");
        return mapperScannerConfigurer;
    }

}

